package com.example.dell.jakatra;

/**
 * Created by liangjianwei on 2017/12/27.
 */

public class NetManager {

    private static NetManager mNetManager;

    public static NetManager getInstance() {
        if (mNetManager == null) {
            synchronized (NetManager.class) {
                if (mNetManager == null) {
                    mNetManager = new NetManager();
                }
            }
        }
        return mNetManager;
    }

    public void setNet(boolean b) {
        if (listsner != null) {
            if (b) {
                listsner.success();
            } else {
                listsner.fail();
            }
        }
    }

    private onNetChangeListsner listsner;

    public void setOnNetChangeListener(onNetChangeListsner listsner) {
        this.listsner = listsner;
    }

    public interface onNetChangeListsner {
        void success();

        void fail();
    }
}
